<?php
/**
 * (logic) 清空tmp临时表
 */
namespace App\Logic\MonthlyReportLT;

use Illuminate\Support\Facades\DB;
class TruncateTmp
{
    public static function exe()
    {
        try{
            $sql = DB::select("SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'erp-v2' AND table_name LIKE 'lt_mr_tmp_%'");
            foreach ($sql as $_sql){
                DB::table($_sql->table_name)->truncate();
            }
        }catch (\Exception $e){
            report($e);
        }
    }
}
